{extend name="common/sns_layout" /}
{block name="style"}{/block}
{block name="sns_content"}
<div class="sns-main-all">
  <div class="tabmenu"><?php if($relation == '3'){?>
    <div class="release-banner">
      
      <span class="btn"><a href="javascript:void(0);" id="snssharegoods">+ 分享宝贝</a></span><?php if(!empty($goodslist)){?><i></i><h3><strong>分享、晒单</strong>收藏和已购商品，让我的粉丝们<strong>关注</strong>一下！</h3><?php }?>
    </div>
    <?php }?>
    <ul class="tab">
      <li class="active"><i></i><a href="{:url('member/snshome/shareglist')}?type=share&mid=<?php echo $master_info['member_id'];?>">分享的宝贝</a></li>
      <li class="normal"><i></i><a href="{:url('member/snshome/shareglist')}?type=like&mid=<?php echo $master_info['member_id'];?>">喜欢的宝贝</a></li>
    </ul>
    
  </div>
  <div class="sharelist-g mt30">
    <?php if (!empty($goodslist)){?>
    <ul class="nc-sns-pinterest" id="snsPinterest">
      <?php foreach ($goodslist as $k=>$v){ ?>
      <li id="recordone_<?php echo $v['share_id'];?>" class="item">
        <ul class="handle">
          <?php if ($relation == 3){?>
          	<!--//主人自己-->
          <li class="buyer-show"><a href="javascript:void(0)" nctype="add_share" data-param="{'sid':'<?php echo $v['share_id'];?>', 'gid':'<?php echo $v['share_goodsid'];?>'}"><i></i>买家秀</a></li>
          <li class="set" nc_type="privacydiv"><a href="javascript:void(0)" nc_type="formprivacybtn"><i></i>设置</a>
            <ul class="set-menu" nc_type="privacytab" style="display:none;">
              <li nc_type="privacyoption" data-param='{"sid":"<?php echo $v['share_id'];?>","v":"0"}'><span class="<?php echo $v['share_privacy']==0?'selected':'';?>">公开</span></li>
              <li nc_type="privacyoption" data-param='{"sid":"<?php echo $v['share_id'];?>","v":"1"}'><span class="<?php echo $v['share_privacy']==1?'selected':'';?>">好友</span></li>
              <li nc_type="privacyoption" data-param='{"sid":"<?php echo $v['share_id'];?>","v":"2"}'><span class="<?php echo $v['share_privacy']==2?'selected':'';?>">隐私</span></li>
              <li nc_type="delbtn" data-param='{"sid":"<?php echo $v['share_id'];?>","tabtype":"share"}'><span class="del"><a href="javascript:void(0);">删除</a></span></li>
            </ul>
          </li>
          <?php }?>
        </ul>
        <dl>
          <dt class="goodspic"><span class="thumb size233"><i></i><a href="{:url('member/snshome/goodsinfo')}?mid=<?php echo $v['share_memberid'];?>&id=<?php echo $v['share_id'];?>" title="<?php echo $v['snsgoods_goodsname']?>"> <img src="<?php echo cthumb($v['snsgoods_goodsimage'],240,$v['snsgoods_storeid']);?>"/></a></span>
            <?php if(isset($pic_list[$v['share_id']])){?>
            <div class="ap-pic"><span class="num" title="<?php printf($sns_entity_pic_count, $pic_list[$v['share_id']]['count'])?>"><i></i><?php echo $pic_list[$v['share_id']]['count'];?></span><img src="<?php echo $pic_list[$v['share_id']]['ap_cover']?>" /></div>
            <?php }?>
          </dt>
          <dd class="pinterest-cmt"><?php echo $v['share_content'];?></dd>
          <dd class="pinterest-addtime goods-time">于&nbsp;<?php echo @date('Y-m-d H:i',$v['share_addtime']);?>&nbsp;分享</dd>
          <dd class="pinterest-ops"> <span class="ops-like" id="likestat_<?php echo $v['share_goodsid'];?>"> <a href="javascript:void(0);" nc_type="likebtn" data-param='{"gid":"<?php echo $v['share_goodsid'];?>"}' class="<?php echo $v['snsgoods_havelike']==1?'noaction':''; ?>"><i class="<?php echo $v['snsgoods_havelike']==1?'noaction':''; ?> pngFix"></i>喜欢</a> <em nc_type="likecount_<?php echo $v['share_goodsid'];?>"><?php echo $v['snsgoods_likenum'];?></em> </span> <span class="ops-comment"><a href="{:url('member/snshome/goodsinfo')}?mid=<?php echo $v['share_memberid'];?>&id=<?php echo $v['share_id'];?>" title="评论"><i class="pngFix"></i></a><em><?php echo $v['share_commentcount'];?></em> </span> </dd>
          <div class="clear"></div>
        </dl>
      </li>
      <?php }?>
    </ul>
    <div class="clear"></div>
    <div class="pagination  mb30"><?php echo $show_page; ?></div>
    <div class="clear"></div>
    <?php }else {?>
    <?php if ($relation == 3){?>
    <div class="sns-norecord"><i class="goods-ico pngFix"></i><span>您还没有分享过宝贝哦~<br/>从<a href="{:url('member/order/index')}" target="_blank">已购买</a>或<a href="{:url('member/favoritegoods/fglist')}" target="_blank">收藏商品</a>中分享一些宝贝！</span></div>
    <?php }else {?>
    <div class="sns-norecord"><i class="goods-ico pngFix"></i><span>很遗憾！<br/>主人暂无宝贝分享~</span></div>
    <?php }?>
    <?php }?>
  </div>
  <div class="clear">&nbsp;</div>
</div>
<script src="__SITE_RESOURCE__/js/jquery.masonry.js" type="text/javascript"></script> 
<script type="text/javascript">
$(function(){
	var $container = $('#snsPinterest');
		// initialize
		$container.masonry({
  		itemSelector: '.item'
		});
	var msnry = $container.data('masonry');
    //显示分享商品页面
	$('#snssharegoods').click(function(){
	    ajax_form("sharegoods", '分享已买到和收藏的宝贝', "<?php echo url('member/snsindex/sharegoods');?>", 480);
	    return false;
	});
	// 追加
	$('a[nctype="add_share"]').click(function(){
	    eval( "data_str = "+$(this).attr('data-param'));
		ajax_form('add_share', '上传宝贝买家秀', "<?php echo url('member/snshome/add_share');?>?sid="+data_str.sid+"&gid="+data_str.gid, 580);
	});
	// 买家秀
	$('a[nctype="add_pic"]').click(function(){
		
	});
});
</script> 
{/block}
